using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.ComponentModel;
using System.Globalization;
using System.Linq;
using System.Threading;
using ns20;

namespace Newtonsoft.Json.Linq
{
	public abstract class JContainer : JToken, IEnumerable<JToken>, IList<JToken>, ICollection<JToken>, IEnumerable, ITypedList, IBindingList, IList, ICollection, INotifyCollectionChanged
	{
		private class Class116 : IEqualityComparer<JToken>
		{
			public static readonly Class116 class116_0 = new Class116();

			public bool Equals(JToken x, JToken y)
			{
				return object.ReferenceEquals(x, y);
			}

			public int GetHashCode(JToken obj)
			{
				return obj?.GetHashCode() ?? 0;
			}
		}

		internal ListChangedEventHandler listChangedEventHandler_0;

		internal AddingNewEventHandler addingNewEventHandler_0;

		internal NotifyCollectionChangedEventHandler notifyCollectionChangedEventHandler_0;

		private object object_0;

		private bool bool_0;

		protected abstract IList<JToken> ChildrenTokens { get; }

		public override bool HasValues => ChildrenTokens.Count > 0;

		public override JToken First => ChildrenTokens.FirstOrDefault();

		public override JToken Last => ChildrenTokens.LastOrDefault();

		JToken IList<JToken>.this[int index]
		{
			get
			{
				return Newtonsoft_002EJson_002ELinq_002EJContainer_002E_206D_200D_200D_206C_202C_206E_200C_206B_200B_200E_200D_206F_200F_200F_206F_206A_202B_200E_206D_206E_206E_206B_202A_206B_200B_200D_206B_202A_202B_206D_202C_206B_202B_206F_200F_200C_202C_200B_202C_206E_202E(index);
			}
			set
			{
				Newtonsoft_002EJson_002ELinq_002EJContainer_002E_206D_206D_202C_206A_206B_206A_200C_206B_202A_202C_206E_200D_206C_202E_206A_206F_206B_202A_200F_206E_206A_202E_200B_206C_200F_200D_202B_202D_200C_206B_206E_206D_200E_206B_200D_206C_202C_206A_202B_206E_202E(index, value);
			}
		}

		bool ICollection<JToken>.IsReadOnly => false;

		bool IList.IsFixedSize => false;

		bool IList.IsReadOnly => false;

		object IList.this[int index]
		{
			get
			{
				return Newtonsoft_002EJson_002ELinq_002EJContainer_002E_206D_200D_200D_206C_202C_206E_200C_206B_200B_200E_200D_206F_200F_200F_206F_206A_202B_200E_206D_206E_206E_206B_202A_206B_200B_200D_206B_202A_202B_206D_202C_206B_202B_206F_200F_200C_202C_200B_202C_206E_202E(index);
			}
			set
			{
				Newtonsoft_002EJson_002ELinq_002EJContainer_002E_206D_206D_202C_206A_206B_206A_200C_206B_202A_202C_206E_200D_206C_202E_206A_206F_206B_202A_200F_206E_206A_202E_200B_206C_200F_200D_202B_202D_200C_206B_206E_206D_200E_206B_200D_206C_202C_206A_202B_206E_202E(index, method_13(value));
			}
		}

		public int Count => ChildrenTokens.Count;

		bool ICollection.IsSynchronized => false;

		object ICollection.SyncRoot
		{
			get
			{
				if (object_0 == null)
				{
					Interlocked.CompareExchange(ref object_0, new object(), null);
				}
				return object_0;
			}
		}

		bool IBindingList.AllowEdit => true;

		bool IBindingList.AllowNew => true;

		bool IBindingList.AllowRemove => true;

		bool IBindingList.IsSorted => false;

		ListSortDirection IBindingList.SortDirection => ListSortDirection.Ascending;

		PropertyDescriptor IBindingList.SortProperty => null;

		bool IBindingList.SupportsChangeNotification => true;

		bool IBindingList.SupportsSearching => false;

		bool IBindingList.SupportsSorting => false;

		public event ListChangedEventHandler ListChanged
		{
			add
			{
				listChangedEventHandler_0 = (ListChangedEventHandler)Delegate.Combine(listChangedEventHandler_0, value);
			}
			remove
			{
				listChangedEventHandler_0 = (ListChangedEventHandler)Delegate.Remove(listChangedEventHandler_0, value);
			}
		}

		public event AddingNewEventHandler AddingNew
		{
			add
			{
				addingNewEventHandler_0 = (AddingNewEventHandler)Delegate.Combine(addingNewEventHandler_0, value);
			}
			remove
			{
				addingNewEventHandler_0 = (AddingNewEventHandler)Delegate.Remove(addingNewEventHandler_0, value);
			}
		}

		public event NotifyCollectionChangedEventHandler CollectionChanged
		{
			add
			{
				notifyCollectionChangedEventHandler_0 = (NotifyCollectionChangedEventHandler)Delegate.Combine(notifyCollectionChangedEventHandler_0, value);
			}
			remove
			{
				notifyCollectionChangedEventHandler_0 = (NotifyCollectionChangedEventHandler)Delegate.Remove(notifyCollectionChangedEventHandler_0, value);
			}
		}

		internal JContainer()
		{
		}

		internal JContainer(JContainer other)
			: this()
		{
			Class204.smethod_2(other, "c");
			foreach (JToken item in (IEnumerable<JToken>)other)
			{
				Add(item);
			}
		}

		internal void method_2()
		{
			if (bool_0)
			{
				throw new InvalidOperationException("Cannot change {0} during a collection change event.".smethod_0(CultureInfo.InvariantCulture, GetType()));
			}
		}

		internal virtual IList<JToken> vmethod_0()
		{
			return new List<JToken>();
		}

		protected virtual void OnAddingNew(AddingNewEventArgs e)
		{
			addingNewEventHandler_0?.Invoke(this, e);
		}

		protected virtual void OnListChanged(ListChangedEventArgs e)
		{
			ListChangedEventHandler listChangedEventHandler = listChangedEventHandler_0;
			if (listChangedEventHandler != null)
			{
				bool_0 = true;
				try
				{
					listChangedEventHandler(this, e);
				}
				finally
				{
					bool_0 = false;
				}
			}
		}

		protected virtual void OnCollectionChanged(NotifyCollectionChangedEventArgs e)
		{
			NotifyCollectionChangedEventHandler notifyCollectionChangedEventHandler = notifyCollectionChangedEventHandler_0;
			if (notifyCollectionChangedEventHandler != null)
			{
				bool_0 = true;
				try
				{
					notifyCollectionChangedEventHandler(this, e);
				}
				finally
				{
					bool_0 = false;
				}
			}
		}

		internal bool method_3(JContainer jcontainer_1)
		{
			if (jcontainer_1 == this)
			{
				return true;
			}
			IList<JToken> childrenTokens = ChildrenTokens;
			IList<JToken> childrenTokens2 = jcontainer_1.ChildrenTokens;
			if (childrenTokens.Count != childrenTokens2.Count)
			{
				return false;
			}
			int num = 0;
			while (true)
			{
				if (num < childrenTokens.Count)
				{
					if (!childrenTokens[num].Newtonsoft_002EJson_002ELinq_002EJToken_002E_206F_200C_206F_206F_206B_200E_206C_206B_200C_200D_202E_200E_200E_200D_202C_200D_200C_206B_200F_202D_202E_200F_200C_202D_206B_200D_206B_206E_202E_206E_202B_206D_206E_206F_202C_202E_200D_200C_200D_200F_202E(childrenTokens2[num]))
					{
						break;
					}
					num++;
					continue;
				}
				return true;
			}
			return false;
		}

		public override JEnumerable<JToken> Children()
		{
			return new JEnumerable<JToken>(ChildrenTokens);
		}

		public override IEnumerable<T> Values<T>()
		{
			return ChildrenTokens.smethod_1<JToken, T>();
		}

		public IEnumerable<JToken> Descendants()
		{
			foreach (JToken childrenToken in ChildrenTokens)
			{
				yield return childrenToken;
				JContainer jContainer = childrenToken as JContainer;
				if (jContainer == null)
				{
					continue;
				}
				foreach (JToken item in jContainer.Descendants())
				{
					yield return item;
				}
			}
		}

		internal bool method_4(object object_1)
		{
			if (object_1 is IEnumerable && !(object_1 is string) && !(object_1 is JToken))
			{
				return !(object_1 is byte[]);
			}
			return false;
		}

		internal JToken method_5(JToken jtoken_2, bool bool_1)
		{
			if (jtoken_2 == null)
			{
				return new JValue((object)null);
			}
			if (bool_1)
			{
				return jtoken_2;
			}
			if (jtoken_2.Parent != null || jtoken_2 == this || (jtoken_2.HasValues && base.Root == jtoken_2))
			{
				jtoken_2 = jtoken_2.Newtonsoft_002EJson_002ELinq_002EJToken_002E_206F_206A_202E_200B_200D_206A_200C_200E_206A_202D_200E_206E_206F_200B_206C_200F_200C_200C_202A_206B_200C_202D_200B_202B_202A_202D_202B_206A_206F_206F_202D_200C_206F_202E_206B_200D_206C_202D_202E_200E_202E();
			}
			return jtoken_2;
		}

		internal int method_6(JToken jtoken_2)
		{
			return ChildrenTokens.smethod_9(jtoken_2, Class116.class116_0);
		}

		internal virtual void Newtonsoft_002EJson_002ELinq_002EJContainer_002E_206F_206C_206F_206D_202A_200D_202E_202E_200B_202D_202C_206D_200F_202A_200D_202C_202B_202A_206D_202D_202A_200D_206A_200E_206C_206C_200C_202B_206D_200E_206E_200B_200B_206A_202E_200F_206F_206F_202E_206C_202E(int int_0, JToken jtoken_2, bool bool_1)
		{
			if (int_0 > ChildrenTokens.Count)
			{
				throw new ArgumentOutOfRangeException("index", "Index must be within the bounds of the List.");
			}
			method_2();
			jtoken_2 = method_5(jtoken_2, bool_1);
			JToken jToken = ((int_0 == 0) ? null : ChildrenTokens[int_0 - 1]);
			JToken jToken2 = ((int_0 == ChildrenTokens.Count) ? null : ChildrenTokens[int_0]);
			Newtonsoft_002EJson_002ELinq_002EJContainer_002E_200C_200E_206E_206C_200B_202E_202D_202D_200F_200B_200D_200F_206A_200B_206D_202B_200F_206C_200E_206F_202C_206E_202A_200C_200D_206C_202B_200C_202B_202D_200C_200D_200E_202E_206F_206B_200D_202B_202C_206F_202E(jtoken_2, null);
			jtoken_2.Parent = this;
			jtoken_2.Previous = jToken;
			if (jToken != null)
			{
				jToken.Next = jtoken_2;
			}
			jtoken_2.Next = jToken2;
			if (jToken2 != null)
			{
				jToken2.Previous = jtoken_2;
			}
			ChildrenTokens.Insert(int_0, jtoken_2);
			if (listChangedEventHandler_0 != null)
			{
				OnListChanged(new ListChangedEventArgs(ListChangedType.ItemAdded, int_0));
			}
			if (notifyCollectionChangedEventHandler_0 != null)
			{
				OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Add, jtoken_2, int_0));
			}
		}

		internal virtual void Newtonsoft_002EJson_002ELinq_002EJContainer_002E_206F_200D_202C_202E_200E_202D_202C_202B_206F_206A_202C_206A_202A_200F_206C_200D_200F_206C_202D_200E_206C_206E_206F_202C_200E_206B_202E_202D_206B_206F_200B_200C_200E_206F_200C_200F_200D_206F_202C_206A_202E(int int_0)
		{
			if (int_0 < 0)
			{
				throw new ArgumentOutOfRangeException("index", "Index is less than 0.");
			}
			if (int_0 >= ChildrenTokens.Count)
			{
				throw new ArgumentOutOfRangeException("index", "Index is equal to or greater than Count.");
			}
			method_2();
			JToken jToken = ChildrenTokens[int_0];
			JToken jToken2 = ((int_0 == 0) ? null : ChildrenTokens[int_0 - 1]);
			JToken jToken3 = ((int_0 == ChildrenTokens.Count - 1) ? null : ChildrenTokens[int_0 + 1]);
			if (jToken2 != null)
			{
				jToken2.Next = jToken3;
			}
			if (jToken3 != null)
			{
				jToken3.Previous = jToken2;
			}
			jToken.Parent = null;
			jToken.Previous = null;
			jToken.Next = null;
			ChildrenTokens.RemoveAt(int_0);
			if (listChangedEventHandler_0 != null)
			{
				OnListChanged(new ListChangedEventArgs(ListChangedType.ItemDeleted, int_0));
			}
			if (notifyCollectionChangedEventHandler_0 != null)
			{
				OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Remove, jToken, int_0));
			}
		}

		internal virtual bool Newtonsoft_002EJson_002ELinq_002EJContainer_002E_202E_200B_202D_206B_200C_200B_200B_200D_202B_202B_206F_202C_206C_202D_200D_200F_202E_206B_206B_206C_206F_202D_206F_200D_202E_202E_206B_206B_200F_200C_200C_206C_200E_202B_200F_206F_206A_200C_206B_200F_202E(JToken jtoken_2)
		{
			int num = method_6(jtoken_2);
			if (num >= 0)
			{
				Newtonsoft_002EJson_002ELinq_002EJContainer_002E_206F_200D_202C_202E_200E_202D_202C_202B_206F_206A_202C_206A_202A_200F_206C_200D_200F_206C_202D_200E_206C_206E_206F_202C_200E_206B_202E_202D_206B_206F_200B_200C_200E_206F_200C_200F_200D_206F_202C_206A_202E(num);
				return true;
			}
			return false;
		}

		internal virtual JToken Newtonsoft_002EJson_002ELinq_002EJContainer_002E_206D_200D_200D_206C_202C_206E_200C_206B_200B_200E_200D_206F_200F_200F_206F_206A_202B_200E_206D_206E_206E_206B_202A_206B_200B_200D_206B_202A_202B_206D_202C_206B_202B_206F_200F_200C_202C_200B_202C_206E_202E(int int_0)
		{
			return ChildrenTokens[int_0];
		}

		internal virtual void Newtonsoft_002EJson_002ELinq_002EJContainer_002E_206D_206D_202C_206A_206B_206A_200C_206B_202A_202C_206E_200D_206C_202E_206A_206F_206B_202A_200F_206E_206A_202E_200B_206C_200F_200D_202B_202D_200C_206B_206E_206D_200E_206B_200D_206C_202C_206A_202B_206E_202E(int int_0, JToken jtoken_2)
		{
			if (int_0 < 0)
			{
				throw new ArgumentOutOfRangeException("index", "Index is less than 0.");
			}
			if (int_0 >= ChildrenTokens.Count)
			{
				throw new ArgumentOutOfRangeException("index", "Index is equal to or greater than Count.");
			}
			JToken jToken = ChildrenTokens[int_0];
			if (!smethod_6(jToken, jtoken_2))
			{
				method_2();
				jtoken_2 = method_5(jtoken_2, bool_1: false);
				Newtonsoft_002EJson_002ELinq_002EJContainer_002E_200C_200E_206E_206C_200B_202E_202D_202D_200F_200B_200D_200F_206A_200B_206D_202B_200F_206C_200E_206F_202C_206E_202A_200C_200D_206C_202B_200C_202B_202D_200C_200D_200E_202E_206F_206B_200D_202B_202C_206F_202E(jtoken_2, jToken);
				JToken jToken2 = ((int_0 == 0) ? null : ChildrenTokens[int_0 - 1]);
				JToken jToken3 = ((int_0 == ChildrenTokens.Count - 1) ? null : ChildrenTokens[int_0 + 1]);
				jtoken_2.Parent = this;
				jtoken_2.Previous = jToken2;
				if (jToken2 != null)
				{
					jToken2.Next = jtoken_2;
				}
				jtoken_2.Next = jToken3;
				if (jToken3 != null)
				{
					jToken3.Previous = jtoken_2;
				}
				ChildrenTokens[int_0] = jtoken_2;
				jToken.Parent = null;
				jToken.Previous = null;
				jToken.Next = null;
				if (listChangedEventHandler_0 != null)
				{
					OnListChanged(new ListChangedEventArgs(ListChangedType.ItemChanged, int_0));
				}
				if (notifyCollectionChangedEventHandler_0 != null)
				{
					OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Replace, jtoken_2, jToken, int_0));
				}
			}
		}

		internal virtual void Newtonsoft_002EJson_002ELinq_002EJContainer_002E_200E_202C_200D_206A_202A_200C_202D_200E_200B_206E_200D_202B_202E_202C_200D_200B_202C_202E_206B_200B_206D_202A_202C_202D_202B_202B_206B_200D_200B_206B_206D_200C_202B_206D_202E_202A_200F_200C_206C_206C_202E()
		{
			method_2();
			foreach (JToken childrenToken in ChildrenTokens)
			{
				childrenToken.Parent = null;
				childrenToken.Previous = null;
				childrenToken.Next = null;
			}
			ChildrenTokens.Clear();
			if (listChangedEventHandler_0 != null)
			{
				OnListChanged(new ListChangedEventArgs(ListChangedType.Reset, -1));
			}
			if (notifyCollectionChangedEventHandler_0 != null)
			{
				OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset));
			}
		}

		internal virtual void vmethod_1(JToken jtoken_2, JToken jtoken_3)
		{
			if (jtoken_2 != null && jtoken_2.Parent == this)
			{
				int int_ = method_6(jtoken_2);
				Newtonsoft_002EJson_002ELinq_002EJContainer_002E_206D_206D_202C_206A_206B_206A_200C_206B_202A_202C_206E_200D_206C_202E_206A_206F_206B_202A_200F_206E_206A_202E_200B_206C_200F_200D_202B_202D_200C_206B_206E_206D_200E_206B_200D_206C_202C_206A_202B_206E_202E(int_, jtoken_3);
			}
		}

		internal virtual bool Newtonsoft_002EJson_002ELinq_002EJContainer_002E_202B_206F_202C_202A_206C_200C_206A_206E_200F_202B_206E_200D_206E_206A_206E_206A_202A_202C_202C_200C_200B_200E_206D_200E_206F_206C_206F_202C_202E_200F_202D_200F_206E_206A_200F_202D_202E_200F_202E_206B_202E(JToken jtoken_2)
		{
			return method_6(jtoken_2) != -1;
		}

		internal virtual void vmethod_2(Array array_0, int int_0)
		{
			if (array_0 == null)
			{
				throw new ArgumentNullException("array");
			}
			if (int_0 < 0)
			{
				throw new ArgumentOutOfRangeException("arrayIndex", "arrayIndex is less than 0.");
			}
			if (int_0 >= array_0.Length && int_0 != 0)
			{
				throw new ArgumentException("arrayIndex is equal to or greater than the length of array.");
			}
			if (Count > array_0.Length - int_0)
			{
				throw new ArgumentException("The number of elements in the source JObject is greater than the available space from arrayIndex to the end of the destination array.");
			}
			int num = 0;
			foreach (JToken childrenToken in ChildrenTokens)
			{
				array_0.SetValue(childrenToken, int_0 + num);
				num++;
			}
		}

		internal static bool smethod_6(JToken jtoken_2, JToken jtoken_3)
		{
			JValue jValue = jtoken_2 as JValue;
			if (jValue != null)
			{
				if (jValue.Type == JTokenType.Null && jtoken_3 == null)
				{
					return true;
				}
				return jValue.Equals(jtoken_3);
			}
			return false;
		}

		internal virtual void Newtonsoft_002EJson_002ELinq_002EJContainer_002E_200C_200E_206E_206C_200B_202E_202D_202D_200F_200B_200D_200F_206A_200B_206D_202B_200F_206C_200E_206F_202C_206E_202A_200C_200D_206C_202B_200C_202B_202D_200C_200D_200E_202E_206F_206B_200D_202B_202C_206F_202E(JToken jtoken_2, JToken jtoken_3)
		{
			Class204.smethod_2(jtoken_2, "o");
			if (jtoken_2.Type == JTokenType.Property)
			{
				throw new ArgumentException("Can not add {0} to {1}.".smethod_1(CultureInfo.InvariantCulture, jtoken_2.GetType(), GetType()));
			}
		}

		public virtual void Add(object content)
		{
			method_8(ChildrenTokens.Count, content, bool_1: false);
		}

		internal void method_7(JToken jtoken_2)
		{
			method_8(ChildrenTokens.Count, jtoken_2, bool_1: true);
		}

		public void AddFirst(object content)
		{
			method_8(0, content, bool_1: false);
		}

		internal void method_8(int int_0, object object_1, bool bool_1)
		{
			if (method_4(object_1))
			{
				IEnumerable enumerable = (IEnumerable)object_1;
				int num = int_0;
				foreach (object item in enumerable)
				{
					method_8(num, item, bool_1);
					num++;
				}
			}
			else
			{
				JToken jtoken_ = method_9(object_1);
				Newtonsoft_002EJson_002ELinq_002EJContainer_002E_206F_206C_206F_206D_202A_200D_202E_202E_200B_202D_202C_206D_200F_202A_200D_202C_202B_202A_206D_202D_202A_200D_206A_200E_206C_206C_200C_202B_206D_200E_206E_200B_200B_206A_202E_200F_206F_206F_202E_206C_202E(int_0, jtoken_, bool_1);
			}
		}

		internal JToken method_9(object object_1)
		{
			if (object_1 is JToken)
			{
				return (JToken)object_1;
			}
			return new JValue(object_1);
		}

		public JsonWriter CreateWriter()
		{
			return new JTokenWriter(this);
		}

		public void ReplaceAll(object content)
		{
			Newtonsoft_002EJson_002ELinq_002EJContainer_002E_200E_202C_200D_206A_202A_200C_202D_200E_200B_206E_200D_202B_202E_202C_200D_200B_202C_202E_206B_200B_206D_202A_202C_202D_202B_202B_206B_200D_200B_206B_206D_200C_202B_206D_202E_202A_200F_200C_206C_206C_202E();
			Add(content);
		}

		public void RemoveAll()
		{
			Newtonsoft_002EJson_002ELinq_002EJContainer_002E_200E_202C_200D_206A_202A_200C_202D_200E_200B_206E_200D_202B_202E_202C_200D_200B_202C_202E_206B_200B_206D_202A_202C_202D_202B_202B_206B_200D_200B_206B_206D_200C_202B_206D_202E_202A_200F_200C_206C_206C_202E();
		}

		internal void method_10(JsonReader jsonReader_0)
		{
			int int32_ = jsonReader_0.Int32_0;
			if (!jsonReader_0.Read())
			{
				throw JsonReaderException.smethod_1(jsonReader_0, "Error reading {0} from JsonReader.".smethod_0(CultureInfo.InvariantCulture, GetType().Name));
			}
			method_11(jsonReader_0);
			int int32_2 = jsonReader_0.Int32_0;
			if (int32_2 > int32_)
			{
				throw JsonReaderException.smethod_1(jsonReader_0, "Unexpected end of content while loading {0}.".smethod_0(CultureInfo.InvariantCulture, GetType().Name));
			}
		}

		internal void method_11(JsonReader jsonReader_0)
		{
			Class204.smethod_2(jsonReader_0, "r");
			IJsonLineInfo ijsonLineInfo_ = jsonReader_0 as IJsonLineInfo;
			JContainer jContainer = this;
			do
			{
				if (jContainer is JProperty && ((JProperty)jContainer).Value != null)
				{
					if (jContainer == this)
					{
						break;
					}
					jContainer = jContainer.Parent;
				}
				switch (jsonReader_0.JsonToken_0)
				{
				case JsonToken.StartObject:
				{
					JObject jObject = new JObject();
					jObject.method_0(ijsonLineInfo_);
					jContainer.Add(jObject);
					jContainer = jObject;
					break;
				}
				case JsonToken.StartArray:
				{
					JArray jArray = new JArray();
					jArray.method_0(ijsonLineInfo_);
					jContainer.Add(jArray);
					jContainer = jArray;
					break;
				}
				case JsonToken.StartConstructor:
				{
					JConstructor jConstructor = new JConstructor(jsonReader_0.Object_0.ToString());
					jConstructor.method_0(jConstructor);
					jContainer.Add(jConstructor);
					jContainer = jConstructor;
					break;
				}
				case JsonToken.PropertyName:
				{
					string name = jsonReader_0.Object_0.ToString();
					JProperty jProperty = new JProperty(name);
					jProperty.method_0(ijsonLineInfo_);
					JObject jObject2 = (JObject)jContainer;
					JProperty jProperty2 = jObject2.Property(name);
					if (jProperty2 == null)
					{
						jContainer.Add(jProperty);
					}
					else
					{
						jProperty2.Replace(jProperty);
					}
					jContainer = jProperty;
					break;
				}
				case JsonToken.Comment:
				{
					JValue jValue = JValue.CreateComment(jsonReader_0.Object_0.ToString());
					jValue.method_0(ijsonLineInfo_);
					jContainer.Add(jValue);
					break;
				}
				case JsonToken.Null:
				{
					JValue jValue = new JValue(null, JTokenType.Null);
					jValue.method_0(ijsonLineInfo_);
					jContainer.Add(jValue);
					break;
				}
				case JsonToken.Undefined:
				{
					JValue jValue = new JValue(null, JTokenType.Undefined);
					jValue.method_0(ijsonLineInfo_);
					jContainer.Add(jValue);
					break;
				}
				case JsonToken.EndObject:
					if (jContainer == this)
					{
						return;
					}
					jContainer = jContainer.Parent;
					break;
				case JsonToken.EndArray:
					if (jContainer == this)
					{
						return;
					}
					jContainer = jContainer.Parent;
					break;
				case JsonToken.EndConstructor:
					if (jContainer == this)
					{
						return;
					}
					jContainer = jContainer.Parent;
					break;
				case JsonToken.Integer:
				case JsonToken.Float:
				case JsonToken.String:
				case JsonToken.Boolean:
				case JsonToken.Date:
				case JsonToken.Bytes:
				{
					JValue jValue = new JValue(jsonReader_0.Object_0);
					jValue.method_0(ijsonLineInfo_);
					jContainer.Add(jValue);
					break;
				}
				case JsonToken.None:
					break;
				default:
					throw new InvalidOperationException("The JsonReader should not be on a token of type {0}.".smethod_0(CultureInfo.InvariantCulture, jsonReader_0.JsonToken_0));
				}
			}
			while (jsonReader_0.Read());
		}

		internal int method_12()
		{
			int num = 0;
			foreach (JToken childrenToken in ChildrenTokens)
			{
				num ^= childrenToken.Newtonsoft_002EJson_002ELinq_002EJToken_002E_200C_202A_206D_200B_206C_206F_202A_200F_200E_206E_200D_202D_200B_200D_206E_202D_206E_200D_202E_206B_206F_206F_202B_206D_206D_202E_206C_200F_202D_202A_206B_206B_200D_202A_200C_202D_200F_202A_206F_200F_202E();
			}
			return num;
		}

		string ITypedList.GetListName(PropertyDescriptor[] listAccessors)
		{
			return string.Empty;
		}

		PropertyDescriptorCollection ITypedList.GetItemProperties(PropertyDescriptor[] listAccessors)
		{
			return (First as ICustomTypeDescriptor)?.GetProperties();
		}

		int IList<JToken>.IndexOf(JToken item)
		{
			return method_6(item);
		}

		void IList<JToken>.Insert(int index, JToken item)
		{
			Newtonsoft_002EJson_002ELinq_002EJContainer_002E_206F_206C_206F_206D_202A_200D_202E_202E_200B_202D_202C_206D_200F_202A_200D_202C_202B_202A_206D_202D_202A_200D_206A_200E_206C_206C_200C_202B_206D_200E_206E_200B_200B_206A_202E_200F_206F_206F_202E_206C_202E(index, item, bool_1: false);
		}

		void IList<JToken>.RemoveAt(int index)
		{
			Newtonsoft_002EJson_002ELinq_002EJContainer_002E_206F_200D_202C_202E_200E_202D_202C_202B_206F_206A_202C_206A_202A_200F_206C_200D_200F_206C_202D_200E_206C_206E_206F_202C_200E_206B_202E_202D_206B_206F_200B_200C_200E_206F_200C_200F_200D_206F_202C_206A_202E(index);
		}

		void ICollection<JToken>.Add(JToken item)
		{
			Add(item);
		}

		void ICollection<JToken>.Clear()
		{
			Newtonsoft_002EJson_002ELinq_002EJContainer_002E_200E_202C_200D_206A_202A_200C_202D_200E_200B_206E_200D_202B_202E_202C_200D_200B_202C_202E_206B_200B_206D_202A_202C_202D_202B_202B_206B_200D_200B_206B_206D_200C_202B_206D_202E_202A_200F_200C_206C_206C_202E();
		}

		bool ICollection<JToken>.Contains(JToken item)
		{
			return Newtonsoft_002EJson_002ELinq_002EJContainer_002E_202B_206F_202C_202A_206C_200C_206A_206E_200F_202B_206E_200D_206E_206A_206E_206A_202A_202C_202C_200C_200B_200E_206D_200E_206F_206C_206F_202C_202E_200F_202D_200F_206E_206A_200F_202D_202E_200F_202E_206B_202E(item);
		}

		void ICollection<JToken>.CopyTo(JToken[] array, int arrayIndex)
		{
			vmethod_2(array, arrayIndex);
		}

		bool ICollection<JToken>.Remove(JToken item)
		{
			return Newtonsoft_002EJson_002ELinq_002EJContainer_002E_202E_200B_202D_206B_200C_200B_200B_200D_202B_202B_206F_202C_206C_202D_200D_200F_202E_206B_206B_206C_206F_202D_206F_200D_202E_202E_206B_206B_200F_200C_200C_206C_200E_202B_200F_206F_206A_200C_206B_200F_202E(item);
		}

		private JToken method_13(object object_1)
		{
			if (object_1 == null)
			{
				return null;
			}
			if (!(object_1 is JToken))
			{
				throw new ArgumentException("Argument is not a JToken.");
			}
			return (JToken)object_1;
		}

		int IList.Add(object value)
		{
			Add(method_13(value));
			return Count - 1;
		}

		void IList.Clear()
		{
			Newtonsoft_002EJson_002ELinq_002EJContainer_002E_200E_202C_200D_206A_202A_200C_202D_200E_200B_206E_200D_202B_202E_202C_200D_200B_202C_202E_206B_200B_206D_202A_202C_202D_202B_202B_206B_200D_200B_206B_206D_200C_202B_206D_202E_202A_200F_200C_206C_206C_202E();
		}

		bool IList.Contains(object value)
		{
			return Newtonsoft_002EJson_002ELinq_002EJContainer_002E_202B_206F_202C_202A_206C_200C_206A_206E_200F_202B_206E_200D_206E_206A_206E_206A_202A_202C_202C_200C_200B_200E_206D_200E_206F_206C_206F_202C_202E_200F_202D_200F_206E_206A_200F_202D_202E_200F_202E_206B_202E(method_13(value));
		}

		int IList.IndexOf(object value)
		{
			return method_6(method_13(value));
		}

		void IList.Insert(int index, object value)
		{
			Newtonsoft_002EJson_002ELinq_002EJContainer_002E_206F_206C_206F_206D_202A_200D_202E_202E_200B_202D_202C_206D_200F_202A_200D_202C_202B_202A_206D_202D_202A_200D_206A_200E_206C_206C_200C_202B_206D_200E_206E_200B_200B_206A_202E_200F_206F_206F_202E_206C_202E(index, method_13(value), bool_1: false);
		}

		void IList.Remove(object value)
		{
			Newtonsoft_002EJson_002ELinq_002EJContainer_002E_202E_200B_202D_206B_200C_200B_200B_200D_202B_202B_206F_202C_206C_202D_200D_200F_202E_206B_206B_206C_206F_202D_206F_200D_202E_202E_206B_206B_200F_200C_200C_206C_200E_202B_200F_206F_206A_200C_206B_200F_202E(method_13(value));
		}

		void IList.RemoveAt(int index)
		{
			Newtonsoft_002EJson_002ELinq_002EJContainer_002E_206F_200D_202C_202E_200E_202D_202C_202B_206F_206A_202C_206A_202A_200F_206C_200D_200F_206C_202D_200E_206C_206E_206F_202C_200E_206B_202E_202D_206B_206F_200B_200C_200E_206F_200C_200F_200D_206F_202C_206A_202E(index);
		}

		void ICollection.CopyTo(Array array, int index)
		{
			vmethod_2(array, index);
		}

		void IBindingList.AddIndex(PropertyDescriptor property)
		{
		}

		object IBindingList.AddNew()
		{
			AddingNewEventArgs addingNewEventArgs = new AddingNewEventArgs();
			OnAddingNew(addingNewEventArgs);
			if (addingNewEventArgs.NewObject == null)
			{
				throw new JsonException("Could not determine new value to add to '{0}'.".smethod_0(CultureInfo.InvariantCulture, GetType()));
			}
			if (!(addingNewEventArgs.NewObject is JToken))
			{
				throw new JsonException("New item to be added to collection must be compatible with {0}.".smethod_0(CultureInfo.InvariantCulture, typeof(JToken)));
			}
			JToken jToken = (JToken)addingNewEventArgs.NewObject;
			Add(jToken);
			return jToken;
		}

		void IBindingList.ApplySort(PropertyDescriptor property, ListSortDirection direction)
		{
			throw new NotSupportedException();
		}

		int IBindingList.Find(PropertyDescriptor property, object key)
		{
			throw new NotSupportedException();
		}

		void IBindingList.RemoveIndex(PropertyDescriptor property)
		{
		}

		void IBindingList.RemoveSort()
		{
			throw new NotSupportedException();
		}
	}
}
